package com.zhijiang.hospital.service.impl;

import com.zhijiang.hospital.entrty.MeetingCheckRecode;
import com.zhijiang.hospital.entrty.dto.EmployeeDto;
import com.zhijiang.hospital.mapper.EmployeeDtoMapper;
import com.zhijiang.hospital.service.EmployeeDtoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

/**
 * @author 75936
 * @version 1.0
 * @project zhiJiangHealthBureau
 * @description
 * @date 2023-01-10 15:56:47
 */
@Service
public class EmployeeDtoServiceImpl implements EmployeeDtoService {
    @Autowired
    EmployeeDtoMapper employeeDtoMapper;


    @Override
    public List<EmployeeDto> findSingInEmployee(String mCode) {
        return  employeeDtoMapper.findSingInEmployee(mCode);
    }

    @Override
    public List<EmployeeDto> selectLateEmployee(String mCode) {

        return employeeDtoMapper.selectLateEmployee(mCode);
    }

    @Override
    public List<EmployeeDto> selectNotSingInEmployee(String mCode) {
        List<EmployeeDto> employeeDtos = employeeDtoMapper.finAllEmployee();
        List<EmployeeDto> singInEmployee = employeeDtoMapper.findSingInEmployee(mCode);
        List<EmployeeDto> employeeDtos1 = employeeDtoMapper.selectLateEmployee(mCode);
        singInEmployee.addAll(employeeDtos1);
        HashSet<EmployeeDto> employeeSet = new HashSet<>(employeeDtos);
        HashSet<EmployeeDto> employeeDtoHashSet = new HashSet<>(singInEmployee);
        employeeSet.remove(employeeDtoHashSet);
        ArrayList<EmployeeDto> list = new ArrayList<>();
        list.addAll(employeeSet);
        return list;
    }

    @Override
    public List<MeetingCheckRecode> findSignEmployee(String mCode) {
        return null;
    }

    @Override
    public Integer delete(String mCode, String iphone) {


        return null;
    }


}
